<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="viewport"
        content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;">
        <link rel="stylesheet" href="<?php echo base_url().'public/home/' ?>css/general.css">
    <script src="<?php echo base_url().'public/home/' ?>js/jquery-2.0.3.min.js"></script>
    
    <title>信息反馈列表</title>
</head>
<style>
    .top {
        width: 100%;
        height: 50px;
        margin-top: 0.1%;
        background-color: #fff;
    }

    .top form {
        padding-top: 4%;
        padding-left: 4%;
        padding-right: 4%;
        text-align: center;
    }

    .top form table {
        width: 100%;
        text-align: center;
    }

    .user {
        appearance: none;
        border: 0;
        color: #797979;
        background-color: #fff;
        /* background-image: url(../images/drop_down.png);
        background-position: 35px 4px;
        background-size: 21%;
        background-repeat: no-repeat; */
    }
    
    .min {
        height: auto;
        margin: 5%;
       
    }

    .fk {
        width: 100%;
        height: auto;
        border-radius: 4px;
        background-color: #fff;
        margin-bottom: 5%;
    }

    .number{
        margin-left: 5%;
    }

    .fk p {
        display: inline;
    }

    .jg {
        margin-top: 5%;
        margin-bottom: 2%;
        
    }

    .tet {
        line-height: 22px;
        color: #838383;
        font-size: 8px;
        margin-right: 3%;
    }
    

    .setting_down {
        width: 40px;
        height: 25px;
        line-height: 25px;
        color: #3577F7;
        font-size: 8px;
        background-color: #fff;
        border-style: none;
        margin-left: 75%;
        transform: translate(81%, -10%);
    }
</style>

<body>
    
    <div class="min">
    <input type="hidden" name="url" id="url" value="<?php echo base_url() ?>">
    <input type="hidden" name="admin_id" id="admin_id" value="<?php echo $_SESSION[SESS_USER_HOME]['id'] ?>">
        

    </div>
      
    <div class="loading" style="text-align:center;"><img src="<?php echo base_url().'public/home/' ?>images/loading1.gif" ></div> <!--刷新数据图片-->
        <div class="tip" style="display: none;text-align:center;color: #5d5d5d;line-height:150px">到底了,没有数据了~</div>


<script>

    let admin_id = $('#admin_id').val();
    let pageNo = 1;
    let pageSize = 20;
    let have = true;
    $(function () {
        console.log(pageNo);
        console.log(pageSize);
        getList();

         //分页
        $(window).scroll(function(){
            // scroll at bottom

            if ($(window).scrollTop() + $(window).height() == $(document).height()) {
                pageNo++;
                getList()
            }
        });
    })

    

    function getList(){
        if(have){
            $.ajax({
                url: $("#url").val()+"/Home/Attend/teacherFeedBack",
                dataType: "json",
                type: "post",
                data: {
                    pageNo: pageNo,
                    pageSize: pageSize,
                    admin_id: $("#admin_id").val(),
                },
                success: function (data) {
                    let t = JSON.parse(data.v);
                    console.log(t);
                    let html = '';

                    //if判断有无数据
                    if(status = true){
                        
                        if(t.count==0){
                            $(".loading").hide();
                            $(".tip").show();
                        }

                        $.each(t.ret, function (k, v) {
                        // console.log(k);
                        let a = (pageNo-1)*pageSize+(k+1) + '.' ;


                        html += `<div class="fk">
                            <div style="padding-top: 5%;margin-bottom: 5%;font-size: 14px;">
                            <span  class="number"><p class="snumber">${a}</p></span>
                            <span class="jg" style="padding-bottom: 3%;">反馈时间：${v.created}<p id="dataso"></p></span>
                            </div>
                            <div style="margin-left:5%;font-size:13px;">反馈内容</div>
                            <div class="tet" id="tet" style="margin-left:5%;margin-top:2%;padding-bottom:2%; height:auto;">
                                ${v.content}
                                </div>
                            
                            
                            
                            
                        </div>`

                        
                      
                        // 判断是否还有数据
                        if( pageNo==t.totalPage){
                            have=false
                            $(".loading").hide();
                            $(".tip").show();

                            
                        }

                        
                        // $('.min').append(html);
                    });
                    $('.min').append(html);


                    }else if(status = false){
                        $(".loading").hide();
                            $(".tip").show();
                        }
                    
                },
            });
        }
    }

</script>

</body>


</html>